var express = require('express');
var router = express.Router();
const { get,update,search } = require("../service/orderService.js")


router.post('/getOrder', async function (req, res, next) {
  const parameter = req.query;
  const data = await get(parameter);
  res.send(data);
});

router.post('/updateOrder', async function (req, res, next) {
  const parameter = req.body;
  const {_id} = req.body;
  const data = await update(_id,parameter);
  res.send(data);
});

router.post('/searchOrder', async function (req, res, next) {
  const parameter = req.body;
  const data = await search(parameter);
  res.send(data);
});

module.exports = router;
